package com.cow.sram.data.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.cow.sram.data.entity.Roleresource;



public interface RoleresourceDAO extends JpaRepository<Roleresource, Serializable>{
	List<Roleresource> findByRoleidAndResourceid(Integer roleId,Integer resourceId);
	/**删除装修业务*/
	@Modifying
	@Query("DELETE from Roleresource where roleid=:roleid and resourceid in(SELECT resourceid from Resourceinfo where resourcetype=:resourcetype and systemid=:systemid)")
	public void delRoleResourceByroleId(@Param("roleid") Integer roleid,@Param("resourcetype") String resourcetype,@Param("systemid") String systemid);
}
